/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package beans;

import java.util.Date;
import org.apache.commons.lang3.StringEscapeUtils;
import net.sourceforge.stripes.util.HtmlUtil;



/**
 * Class represented on user row in db.
 * @author Tomas CASTA
 */
public class UserBean {
    /** user id */
    private int id;
    /** user login */
    private String login;
    /** user password */
    private String password;
    /** user email */
    private String email;
    /** user info */
    private String info;
    /** user gender */
    private String gender;
    /** user date of birth */
    private Date dateOfBirth;
    /** is user admin? 1 yes, 0 no*/
    private int admin;
    public static final int ADMIN = 1;
    public static final int USER = 0;

    /**
     * Constructor escape given attributes.
     * @param id int user id
     * @param login String user login
     * @param password String user password
     * @param email String user email
     * @param info String user info
     * @param gender String user gender
     * @param dateOfBirth Date user date of birth
     * @param admin int if user is admin 1 yes, 0 no
     */
    public UserBean(int id, String login, String password, String email, String info, String gender, Date dateOfBirth, int admin) {
        this.id = id;
        this.login = HtmlUtil.encode(login);
        this.password = HtmlUtil.encode(password);
        this.email = HtmlUtil.encode(email);
        this.info = HtmlUtil.encode(info);
        this.gender = HtmlUtil.encode(gender);
        this.dateOfBirth = dateOfBirth;
        this.admin = admin;
    }

    public Date getDateOfBirth() {
        return dateOfBirth;
    }

    public String getEmail() {
        return email;
    }

    public String getGender() {
        return gender;
    }

    public String getInfo() {
        return info;
    }

    public String getLogin() {
        return login;
    }

    public String getPassword() {
        return password;
    }

    public int getId() {
        return id;
    }

    public void setDateOfBirth(Date dateOfBirth) {
        this.dateOfBirth = dateOfBirth;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setAdmin(int admin) {
        this.admin = admin;
    }

    public int getAdmin() {
        return admin;
    }



    


}
